<% layout('layout.ejs') -%>
<div ng-controller="AddConfigCtr">
    <div class="col-md-6">
        <div class="box box-primary"   data-ng-init="load(<%= config %>)">
            <div class="box-body">
                <div class="form-group">
                    <label>配置标识</label>
                    <input class="form-control" type="text" placeholder="" ng-model="config.name">
                </div>
                <div class="form-group">
                    <label>配置标题</label>
                    <input class="form-control" type="text" placeholder="" ng-model="config.title">
                </div>
                <div class="form-group">
                    <label>排序</label>
                    <input class="form-control" type="text" placeholder="" ng-model="config.sort">
                </div>
                <div class="form-group">
                    <label>配置类型</label>
                    <select class="form-control" ng-model="config.type" ng-options="type.id as type.name for type in types" ng-change="type_change()">
                    </select>
                </div>
                <div class="form-group">
                    <label>配置分组</label>
                    <select class="form-control" ng-model="config.group" ng-options="group.id as group.name for group in groups" ng-change="group_change()">
                    </select>
                </div>
                <div class="form-group">
                    <label>配置值</label>
                    <textarea class="form-control" placeholder="" rows="3" ng-model="config.extra"></textarea>
                </div>
                <div class="form-group">
                    <label>配置项（枚举项）</label>
                    <textarea class="form-control" placeholder="" rows="3" ng-model="config.value"></textarea>
                </div>
                <div class="form-group">
                    <label>说明</label>
                    <textarea class="form-control" placeholder="" rows="3"  ng-model="config.remark"></textarea>
                </div>
                <div class="box-footer">
                    <button class="btn btn-primary" type="submit" ng-click="save_config()">提交</button>
                    <button class="btn btn-primary" type="submit" onclick="showTips('tip','请输入')">提交</button>
                    <button class="btn btn-primary" type="submit" onclick="showTips('wrong','数据格式错误')">提交</button>
                    <button class="btn btn-primary" type="submit" onclick="showTips('error','保存失败')">提交</button>
                    <button class="btn btn-primary" type="button" onclick="window.location='/basedata/configManage'">返回</button>
                </div>
            </div>
        </div>
    </div>
</div>
<% block('footer').append('<script src="/script/basedata.js"></script>') %>
<% block('footer').append('<script src="/script/filters.js"></script>') %>